home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / v9n20.arc / PLUS_UD2.ASP < prev    next >
Text File  |  1990-10-29  |  7KB  |  216 lines

  1. ;
  2. ; PC MagNet Utilities Database Down Load Script,
  3. ; written for/with Procomm Plus v1.1b,
  4. ; by Rick Ayre 6.2.90.
  5. ;
  6.  
  7. ASSIGN S1 "EMPTY"      ; create five string variables,
  8. ASSIGN S2 "EMPTY"      ; and place the string EMPTY
  9. ASSIGN S3 "EMPTY"      ; in each
  10. ASSIGN S4 "EMPTY"
  11. ASSIGN S5 "EMPTY"
  12.  
  13. GET_NAMES:        ; routine to create a menu that asks the user
  14.    CLEAR          ; for the names of the files to down load
  15.    BOX 2 20 9 68 79                                   ; draw box
  16.    ATSAY 3 28 15 "PC MagNet Utilities Database"       ; place text in box
  17. ;  ATSAY 5 28 15 "Down Load Script"
  18.    ATSAY 7 28 15 "File to Down Load: "
  19.    ATSAY 7 47 15 "____________"
  20.    ATGET 7 47 15 12 S0                                ; get file name
  21.    SWITCH S0
  22.       CASE "_NULL"               ; make sure there IS a file name
  23.          GOTO What_Now
  24.       ENDCASE
  25.       DEFAULT
  26.          ISFILE S0               ; check to see if file already exists
  27.          IF SUCCESS
  28.             CLEAR
  29.             MESSAGE "File Exists - Get Anyway? (Y/N)"
  30.               GET S7
  31.               SWITCH S7
  32.                  CASE "N"
  33.                     GOTO Main_Menu
  34.                  ENDCASE
  35.                  DEFAULT
  36.                     GOTO File_Names
  37.                  ENDCASE
  38.               ENDSWITCH
  39.          ELSE
  40.             GOTO File_Names
  41.       ENDCASE
  42.    ENDSWITCH
  43.  
  44. FILE_NAMES:       ; routine to grab the file names and assign them to S1-S5
  45.         FIND S1 "EMPTY"          ; check to see if S1 is empty
  46.         IF FOUND                 ; if it is
  47.                 ASSIGN S1 S0     ; put file name in it
  48.         GOTO GET_ANOTHER
  49.         ENDIF
  50.         FIND S2 "EMPTY"          ; if S1 already has a file name
  51.         IF FOUND                 ; check S2
  52.                 ASSIGN S2 S0     ; etc.
  53.         GOTO GET_ANOTHER
  54.         ENDIF
  55.         FIND S3 "EMPTY"
  56.         IF FOUND
  57.                 ASSIGN S3 S0
  58.         GOTO GET_ANOTHER
  59.         ENDIF
  60.         FIND S4 "EMPTY"
  61.         IF FOUND
  62.                 ASSIGN S4 S0
  63.         GOTO GET_ANOTHER
  64.         ENDIF
  65.         FIND S5 "EMPTY"
  66.         IF FOUND
  67.                 ASSIGN S5 S0
  68.         ELSE                     ; if all variable have file names
  69.         CLEAR                    ; clear the screen
  70.         MESSAGE "Only Five Files At a Time!"   ; leave this
  71.         PAUSE 5                                ; message
  72.         GOTO LOG_ON                            ; then jump to the logon routine
  73.         ENDIF
  74.  
  75. GET_ANOTHER:      ; routine that asks if there are more files to down load
  76.         CLEAR
  77.         BOX 2 20 6 60 79
  78.         ATSAY 4 24 15 "Down Load Another (Y/N): "
  79.         ATSAY 4 50 15 "_"
  80.         ATGET 4 50 15 1 S8
  81.                 SWITCH S8
  82.                 CASE "Y"
  83.                         GOTO GET_NAMES
  84.                 ENDCASE
  85.                 CASE "N"
  86.                         GOTO LOG_ON
  87.                 ENDCASE
  88.                 ENDSWITCH
  89.  
  90. WHAT_NOW:         ; routine to recover from off line errors
  91.         CLEAR
  92.         BOX 2 20 6 60 79
  93.         ATSAY 4 24 15 "End This Script? (Y/N): "
  94.         ATSAY 4 52 15 "_"
  95.         ATGET 4 52 15 1 S9
  96.                 SWITCH S9
  97.                 CASE "Y"
  98.                         GOTO GET_OFF
  99.                 ENDCASE
  100.                 CASE "N"
  101.                         GOTO GET_NAMES
  102.                 ENDCASE
  103.                 ENDSWITCH
  104.  
  105. LOG_ON:           ; routine to log on to CompuServe
  106.         FIND S1 "EMPTY"
  107.         IF FOUND
  108.          GOTO Get_Out
  109.     ENDIF
  110.         CLEAR
  111.         IF NOT LINKED
  112.            DIAL "1"   ;the number in your Dialing Directory goes here
  113.         ENDIF
  114.         PAUSE 1
  115.         TRANSMIT "^M"
  116.         IF CONNECTED
  117.            WAITFOR "ost Name:  " 3 ;*
  118.            IF WAITFOR
  119.               PAUSE 1
  120.               TRANSMIT "cis^M"
  121.            ENDIF
  122.         ELSE
  123.            TRANSMIT "^M"
  124.         ENDIF
  125.         WAITFOR "User ID: "
  126.         PAUSE 1
  127.         TRANSMIT "#####,###^M"       ; your UserID goes here in place of "#"s
  128.         WAITFOR "Password: "
  129.         PAUSE 1
  130.         TRANSMIT "*******.*****^M"   ; your Password here in place of "*"s
  131.         CLEAR
  132.         WAITFOR "New"
  133.         PAUSE 4
  134.  
  135. GET_FILE:         ; routine to navigate the PC MagNet Utilites Database
  136.         ASSIGN S0 S1
  137.         TRANSMIT "GO UTILIT^M"
  138.         WAITFOR "!"
  139.         PAUSE 1
  140.         TRANSMIT "4^M"
  141.         WAITFOR "ample, DR.COM): "
  142.         PAUSE 1
  143.         TRANSMIT S0              ; down load file
  144.         TRANSMIT "^M"
  145.         WAITFOR "his file? (Y/N):" 15   ; this conditional WAITFOR
  146.         IF WAITFOR                      ; traps online errors
  147.                 TRANSMIT "Y^M"
  148.         ELSE
  149.                 GOTO ERROR
  150.         ENDIF
  151.         WAITFOR " begin transfer!"
  152.         PAUSE 1
  153.         TRANSMIT "^M"
  154.         WAITFOR "!"
  155.         PAUSE 1
  156.         TRANSMIT "5^M"
  157.         WAITFOR "Downloading..."  ;**** This line, and the GETFILE line
  158.         PAUSE 1
  159.         GETFILE CISB  ;**** must be deleted if you set ENQ to CIS B in Setup
  160.         WAITFOR "!"
  161.         PAUSE 1
  162.  
  163. GIVE_FILE_NAME:           ; routine to pass file names to down load routine
  164.    FIND S5 "EMPTY"               ; check to see if S5 is empty
  165.    IF NOT FOUND                  ; if it isn't
  166.       ASSIGN S1 S5               ; pass that file name to S1 to be down loaded
  167.       ASSIGN S5 "EMPTY"          ; then make it empty
  168.       GOTO GET_FILE
  169.    ENDIF
  170.    FIND S4 "EMPTY"               ; if S5 is already empty
  171.    IF NOT FOUND                  ; check out S4
  172.       ASSIGN S1 S4               ; etc.
  173.       ASSIGN S4 "EMPTY"
  174.       GOTO GET_FILE
  175.    ENDIF
  176.    FIND S3 "EMPTY"
  177.    IF NOT FOUND
  178.       ASSIGN S1 S3
  179.       ASSIGN S3 "EMPTY"
  180.       GOTO GET_FILE
  181.    ENDIF
  182.    FIND S2 "EMPTY"
  183.    IF NOT FOUND
  184.       ASSIGN S1 S2
  185.       ASSIGN S2 "EMPTY"
  186.       GOTO GET_FILE
  187.    ELSE
  188.       GOTO GET_OFF
  189.    ENDIF
  190.  
  191. ERROR:            ; routine to correct from line errors
  192.    CLEAR
  193.    MESSAGE "Can't Find That File"
  194.    MESSAGE "Continue With Next? (Y/N)"
  195.    GET S6
  196.    SWITCH S6
  197.       CASE "Y"
  198.          GOTO LOOP_2
  199.       ENDCASE
  200.       CASE "N"
  201.          GOTO GET_OFF
  202.       ENDCASE
  203.    ENDSWITCH
  204.  
  205. GET_OFF:          ; routine to log off
  206.    TRANSMIT "OFF^M"
  207.    PAUSE 2
  208.    TRANSMIT "OFF^M" ; I know it seems redundent, BUT
  209.    PAUSE 1          ; this is one of those things that MUST be done,
  210.    HANGUP           ; for the few cases when one OFF doesn't take
  211.  
  212. GET_OUT:          ; routine to end script
  213.    CLEAR
  214.    MESSAGE "Thanks for visiting PC MagNet!"
  215.    EXIT
  216.